﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Enterprise.Infrastructure;
using Enterprise.Model.Doc;
using Enterprise.Service.Doc;
using Enterprise.Service.Translation;

namespace Enterprise.UI.Web.Modules.Doc
{
    public partial class Details : Enterprise.Service.BasePage
    {
        protected int Id = (int)Utility.sink("Id", Utility.MethodType.Get, 0, 0, Utility.DataType.Int);
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                OnStart();
            }
        }

        /// <summary>
        /// 初始化数据内容
        /// </summary>
        private void OnStart()
        {
            DocService aService = new DocService();
            var q = aService.DocArticleDisp(Id);
            if (q != null)
            {
                lb_Title.Text = q.TITLE;
                lb_TitleRu.Text = q.TITLERU;
                lb_User.Text = Enterprise.Service.User.UserService.GetUserName(q.PUBUSER);
                lb_Dept.Text = Enterprise.Service.Department.DepartmentService.GetDepartMentName(Enterprise.Service.User.UserService.GetUserDeptId(q.PUBUSER));
                lb_CreateTime.Text = q.PUBDATE.ToString("yyyy年MM月dd日");
                lb_Content.Text = q.CONTENTS;
                lb_ContentRu.Text = q.CONTENTSRU;
                lb_Files.Text = q.UPLOADFILES;
            }
        }
    }
}